#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "app_usart.h"
#include "app_log.h"


// if(usart_tx_dma_send(p_data,len) == true)
#define LOG_START "[APP]"
#define LOG_START_LEN 5
int app_printf(const char *fmt, ...)
{
	va_list ap;
	int len = 0;
	va_start(ap, fmt);
	char buf[128] = LOG_START;
	
	len = vsnprintf(&buf[LOG_START_LEN], 120, fmt, ap);
	
	va_end(ap);
	
	usart_tx_dma_send((uint8_t *)buf, strlen(buf));
	
	return len;
}

